package com.atm.thirdplt.service;

import com.atm.thirdplt.common.core.domain.entity.AnesAnesthesiaPlan;
import com.atm.thirdplt.common.core.domain.entity.AnesOperationMaster;
import com.atm.thirdplt.common.core.domain.entity.AtmOperationScheduleMid;
import com.atm.thirdplt.common.core.domain.his.*;

import java.util.List;

/**
 * his数据本地同步业务接口类
 *
 * @author atm
 */
public interface IHisInfService {

    List<HisUsers> selUsersLocal();

    List<HisDeptDict> selDeptLocal();

    /** 删除临时表科室数据 重新同步最新的 */
    void delHisDept();

    /**
     * 保存科室数据到mongo
     *
     * @param deptList
     */
    void saveDeptDictMongo(List<HisDeptDict> deptList);

    void delDeptMongo();

    /** 保存科室集合信息 */
    int saveDept(List<HisDeptDict> deptList);

    /** 更新工作人员字典信息 */
    void uptHisUser(List<HisUsers> userList);

    /** 更新科室字典信息 */
    void uptHisDept(List<HisDeptDict> deptList);

    void delUserMongo();

    /** 同步工作人员数据，从临时表到正式表 */
    void saveUsersMongo(List<HisUsers> userList);

    /** 保存人员字典信息 */
    void saveUsers(List<HisUsers> userList);

    /**
     * 根据时间范围查询本地手术预约申请信息
     *
     * @param startTime
     * @param endTime
     * @return
     */
    List<HisOperationSchedule> selOpertScheleLocal(String startTime, String endTime);

    void delOperScheMongo(String patientId, String visitId, String startTime, String endTime);

    void saveOperScheMongo(List<HisOperationSchedule> operList);

    void uptOperScheLocal(List<HisOperationSchedule> operList);

    void saveOperScheLocal(List<HisOperationSchedule> operList);

    AnesOperationMaster selOperMasterLocal(String patientId, String visitId, String operId);

    void uptOperMaster(AnesOperationMaster master);

    void uptOperPlain(AnesAnesthesiaPlan plan);

    void intOperMaster(AnesOperationMaster master);

    void intOperPlain(AnesAnesthesiaPlan plan);

    void delPatMasMongo(List<String> patIdList);

    void savePatMasMongo(List<HisPatMasterIndex> list);

    void delPatInHosMongo(HisPatsInHospital patInHos);

    void savePatInHosMongo(List<HisPatsInHospital> list);

    void delOperScheNameMongo(String patId, String visitId, String scheduleId);

    void saveOperScheNameMongo(List<HisScheduledOperationName> list);

    void delOrdersMongo();

    void saveOrdersMongo(List<HisOrders> list);

    void delOperDicMongo();

    void delOperDic();

    void saveOperDicMongo(List<HisOperationDict> list);

    void saveOperDic(List<HisOperationDict> list);

    void delScheOperName(List<HisScheduledOperationName> scheOperNameList);

    void saveScheOperName(List<HisScheduledOperationName> scheOperNameList);

    List<HisPatMasterIndex> selPatInfLocal(List<String> patIdList);

    List<HisPatsInHospital> selPatInHosLocal(List<String> patIdList);

    void uptPatInfLocal(List<HisPatMasterIndex> operList);

    void savePatInfLocal(List<HisPatMasterIndex> operList);

    void uptPatInHosLocal(List<HisPatsInHospital> operList);

    void savePatInHosLocal(List<HisPatsInHospital> operList);

    // 通过中间转换查询手术预约数据
    HisOperationSchedule selOperScheMid(AtmOperationScheduleMid atmOperationScheduleMid);

    void uptOperMidLocal(List<AtmOperationScheduleMid> operList);

    void intOperMidLocal(List<AtmOperationScheduleMid> operList);

    HisOperationSchedule selOperSche(String patientId,String visitId,String scheduleId);
}
